package com.sui.bigdata.rtcadmin.controller;

import com.sui.bigdata.rtcadmin.dto.JobConfigDto;
import com.sui.bigdata.rtcadmin.model.vo.CommonResponse;
import com.sui.bigdata.rtcadmin.service.JobOperationService;
import com.sui.bigdata.rtcadmin.util.CheckUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author YongChen
 * @date 2019/11/6 14:41
 * @description
 * @email yong_chen@sui.com
 */
@RestController
@CrossOrigin
@RequestMapping(value = "/job")
@Slf4j
public class JobOperationController extends BaseController{

    @Autowired
    private JobOperationService jobOperationService;

    @PostMapping
    public CommonResponse action(@RequestParam("action") String action ,@RequestBody JobConfigDto jobConfigDto) throws Exception{
        jobOperationService.action(action,jobConfigDto);
        return CommonResponse.Builder.buildSuccess(null);
    }
}
